package com.evon.yardmanagement.ui.action;

import java.util.List;

//import org.apache.shiro.subject.Subject;

import com.evon.yardmanagement.model.Yard;
import com.evon.yardmanagement.service.YardManagementService;
import com.evon.yardmanagement.transformer.YardTransformer;
import com.evon.yardmanagement.ui.dto.YardDTO;
import com.opensymphony.xwork2.ActionSupport;

public class YardTestAction extends ActionSupport {
	
	/*private Subject shiroUser;

	public Subject getShiroUser() {
		return shiroUser;
	}



	public void setShiroUser(Subject shiroUser) {
		this.shiroUser = shiroUser;
	}
*/


	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private YardDTO availableYard;

	

	public String execute() throws Exception {

		YardManagementService service = new YardManagementService();
		List<Yard> yards = service.getAllYards();
		availableYard = YardTransformer.transform(yards.get(0));
		
		return SUCCESS;
	}



	public YardDTO getAvailableYard() {
		return availableYard;
	}



	public void setAvailableYard(YardDTO availableYard) {
		this.availableYard = availableYard;
	}

}
